<template>
  <div>
    <h2><slot></slot></h2>

    <button @click="onClick">按钮</button>
    <!-- 直接访问 -->
    <p>{{ this.$store.getters['userModule/userInfo'] }}</p>
    <!-- 直接访问 -->
    <p v-text="this.$store.getters['userModule/userInfo']"></p>
  </div>
</template>

<script>
export default {
  name: 'ModuleGetters1',
  methods: {
    onClick() {
      // 直接访问
      const userInfo = this.$store.getters['userModule/userInfo']
      console.log(userInfo)
    }
  }
}
</script>
